<?php
/**
 * @package     Joomla
 * @subpackage  Templates.hihi3dot
 *
 * @copyright   Copyright (C) 2013 AnhTQ.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

// Getting params from template
$params = JFactory::getApplication()->getTemplate(true)->params;

$app = JFactory::getApplication();
$doc = JFactory::getDocument();
$lang = JFactory::getLanguage();
$this->language = $doc->language;
$this->direction = $doc->direction;

// Detecting Active Variables
$option   = $app->input->getCmd('option', '');
$view     = $app->input->getCmd('view', '');
$layout   = $app->input->getCmd('layout', '');
$task     = $app->input->getCmd('task', '');
$itemid   = $app->input->getCmd('Itemid', '');
$sitename = $app->getCfg('sitename');

// Add JavaScript Frameworks
JHtml::_('bootstrap.framework');

// Add Stylesheets
$doc->addStyleSheet('templates/'.$this->template.'/css/template.css');

// Load optional RTL Bootstrap CSS
JHtml::_('bootstrap.loadCss', false, $this->direction);

// Add current user information
$user = JFactory::getUser();

// Logo file or site title param
if ($this->params->get('logoFile'))
{
	$logo = '<img src="'. JURI::root() . $this->params->get('logoFile') .'" alt="'. $sitename .'" />';
}
elseif ($this->params->get('sitetitle'))
{
	$logo = '<span class="site-title" title="'. $sitename .'">'. htmlspecialchars($this->params->get('sitetitle')) .'</span>';
}
else
{
	$logo = '<span class="site-title" title="'. $sitename .'">'. $sitename .'</span>';
}

?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->language; ?>" lang="<?php echo $this->language; ?>" dir="<?php echo $this->direction; ?>">
<head>
	<meta name="viewport" content="width=device-width, initial-scale=1.0" />
	<jdoc:include type="head" />
	<!--[if lt IE 9]>
		<script src="<?php echo $this->baseurl ?>/media/jui/js/html5.js"></script>
	<![endif]-->
</head>

<body>
	<div class="header">
		<div class="container">
			<div class="logo">
				<a href="<?php echo $this->baseurl; ?>">
					<?php echo $logo;?><?php if ($this->params->get('sitedescription')) { echo '<div class="site-description">'. htmlspecialchars($this->params->get('sitedescription')) .'</div>'; } ?>
				</a>
			</div>
			<div class="search">
				<jdoc:include type="modules" name="search" style="none" />
			</div>
		</div>
		<div class="mainmenu">
			<jdoc:include type="modules" name="mainmenu" style="none" />
		</div>
	</div>

	<div class="body">
		<div class="container">
			<?php /* if ($option == 'com_content' && $view = 'featured') : ?>
			<jdoc:include type="modules" name="home" style="none" />
			<?php else : ?>
			<jdoc:include type="component" />
			<?php endif; */?>
			<jdoc:include type="component" />
			<?php if ($view != 'featured') : ?>
			<jdoc:include type="modules" name="sidebar" style="none" />
			<?php endif; ?>
			<?php if ($view == 'featured') : ?>
			<jdoc:include type="modules" name="home" style="xhtml" />
			<?php endif; ?>
		</div>
	</div>
	
	<div class="footer">
		<div class="container">
			<jdoc:include type="modules" name="footer" style="none" />
			<p class="pull-right"><a href="#top" id="back-top" title="<?php echo JText::_('TPL_PROTOSTAR_BACKTOTOP');?>"><?php echo JHtml::image('images/back_to_top.png', JText::_('TPL_PROTOSTAR_BACKTOTOP')); ?></a></p>
			<p>&copy; <?php echo $sitename; ?> <?php echo date('Y');?></p>
		</div>
	</div>
	<jdoc:include type="modules" name="debug" style="none" />
</body>